package com.xysoft.framework.alias;

import java.util.HashMap;
import java.util.Map;

public class AliasRegistryImpl implements AliasRegistry {
	
	private Map<String, String> entityMap = new HashMap<String, String>();
	private Map<String, String> controllerMap = new HashMap<String, String>();

	@Override
	public void register(String alias, String entityName, String controllerName) {
		if(!entityMap.containsKey(alias)) {
			entityMap.put(alias, entityName);
			controllerMap.put(alias, controllerName);
		}
	}

	@Override
	public String getControllerName(String alias) {
		return controllerMap.get(alias);
	}

	@Override
	public String getEntityName(String alias) {
		return entityMap.get(alias);
	}
	
	public Map<String, String> getControllerMap() {
		return controllerMap;
	}

}
